package name.swingeet.rmi;

import name.swingeet.swingElf.SwingTestClient;
import name.swingeet.swingElf.SwingTestInterface;

public class InstallAnyWhereTestSample {
	public static void main(String args[]) throws Exception{

		SwingTestClient stc=new SwingTestClient();
		//Attach Agent to the App
		boolean b=stc.attachAgentToApp("LAX", "d:\\workspace\\javaattach\\Swingeet.jar");
		//stc.detach("LAX");
		if(b)
		System.out.println("Attach sucessfully");
		//Connect and register  to the Agent
		SwingTestInterface sti=stc.registerToAgent();
		//Reference target JVM class
		try{
		stc.referenceAppClass(sti,"com.zerog.lax.LAX");
		}catch(Exception e){
			e.printStackTrace();
		}
		// to do the test step by step

		
		sti.pushButton(" Email Security Installer", "Done");
		System.out.println("eeeeeeeeeeeeeeeeeeeeee");

		
		sti.ConfirmDialogIfExists("Cancel Installation", "Resume");
		boolean b12=sti.isComponentDisplayed(" Email Security Installer", " Email Security Log Server");
		sti.pushButton(" Email Security Installer", "Next",1);
	
		sti.pushButton(" Email Security", "Next");
		
		sti.pushRadioButton(" Web Security", "I accept");
		sti.pushButton(" Web Security", "Next");
		sti.pushRadioButton(" Web Security", "Custom");
		sti.pushButton(" Web Security", "Next");
		sti.setCheckBox(" Web Security", "Policy Broker", true);
		sti.pushButton(" Web Security", "Next");
		sti.setTextInFieldOperator(" Web Security", 0, "10.230.0.200");
		sti.setTextInFieldOperator(" Web Security", 1, "5800");
		
		//Check if the Help component is display in the Frame.
		
		boolean isHelpButtonDisply=sti.isComponentDisplayed(" Web Security", "Help");
		if(isHelpButtonDisply==true)
		System.out.println("The button displayed on the Screen");

	}
}
